import Vue from 'vue'
import App from './App.vue'
import "bootstrap/dist/css/bootstrap.css"
import "./assets/fonts/iconfont.css"
import axios from 'axios'
import router from '@/router'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    goodList: [
      {
        name: "诸葛亮",
        price: 1000,
        num: 1,
        checked: false,
      },
      {
        name: "蔡文姬",
        price: 1500,
        num: 1,
        checked: false,
      },
      {
        name: "妲己",
        price: 2000,
        num: 1,
        checked: false,
      },
      {
        name: "鲁班",
        price: 2200,
        num: 1,
        checked: false,
      },
    ],
  },
  mutations: {
    MINUS(state, payload) {
      state.goodList[payload].num > 0 ? state.goodList[payload].num-- : 0
    },
    ADD(state, payload) {
      state.goodList[payload].num++
    },
    DEL(state, payload) {
      state.goodList.splice(payload, 1)
    },
  }
})
Vue.config.productionTip = false
axios.defaults.baseURL = "https://www.escook.cn"
Vue.prototype.$axios = axios
new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')
